package com.colin.aiyi.dao.ImpxUtils;

import com.colin.aiyi.app.Constant;
import com.colin.aiyi.entity.BaseRequest;
import com.colin.aiyi.entity.response.ChuDaoRespone;

import org.xutils.http.RequestParams;

/**
 * Created by hl on 2017/6/9.
 */

public class ImpAudioDetail extends AbsServicexUtils {
    @Override
    public void onSuccess(String result) {
        super.onSuccess(result);
        ChuDaoRespone loginResponse=gson.fromJson(result,ChuDaoRespone.class);
        loginResponse.setMsgType(Constant.CODE_AUDIO_detail);
        if (callback==null)
        {
            sendMsgToView(result);
        }else {
            callback.onSuccess(result);
        }
    }

    @Override
    public <V> void getObject(V v) {
        super.getObject(v);
        BaseRequest baseRequest= (BaseRequest) v;
        RequestParams params=new RequestParams(Constant.AUDIO_detail);
        params.addBodyParameter("accessToken",baseRequest.getAccessToken());
        sendToServer(params);
    }
}
